
import { useEffect } from 'react'
import { useMeta } from '@/stores'
import FormList from '@/components/FormList'
import FormButtonRow from '@/components/FormList/FormItems/FormButtonRow'
import styles from './index.module.less'
import type { FormListType } from '@/form'

const Feedback = () => {

  const { setMeta } = useMeta((state) => state)

  useEffect(() => {
    setMeta('提交反馈', 'second-page')
  }, [])

  const formList: FormListType = [
    {
      type: 'textarea',
      name: 'feedback',
      label: '反馈意见',
      formItemProps: {
        rules: [
          {
            required: true,
            message: '请输入反馈意见'
          }
        ]
      },
      formFieldProps: {
        maxLength: 200,
        rows: 5
      }
    }
  ]

  return <div className={styles.Feedback}>
    <FormList
      formList={formList}
      footer={<FormButtonRow type='normal' />}
      onSubmit={console.log}
    />
  </div>
}

export default Feedback
